@extends('layouts.console_header')

@section('title', '地推有效用户列表')



@section('resources')
    @parent
    <link rel="stylesheet" href="{{env('CSS_DOMAIN')}}css/jquery.dataTables.min.css?v={{env('CSS_VERSION')}}">
    <style>
        .user_list_search{overflow: hidden;margin: 10px 20px;}
        .user_list_search input{float: right;width: 190px;height: 20px;border: 1px solid #000;padding: 5px;}
        .user_list_search .user_list_searchbtn{float: right;height: 30px;margin-left: 10px;width: 50px;background-color: #9955c6;color: #fff;border: none;cursor: pointer}
        .display{text-align: center;background-color: #fff;border-collapse:collapse;}
        .display th{padding: 20px 5px;}
        .display #tbody_content{border-top: 1px solid #000;border-bottom: 1px solid #000;font-size: 14px;}
        .display #tbody_content tr:nth-child(2n+1){border-bottom: 1px solid #ddd;background-color: #f9f9f9;}
        .display #tbody_content tr:nth-child(2n){border-bottom: 1px solid #ddd;}
        .display #tbody_content tr td{padding: 10px 0;}
        .display #tbody_content tr td:nth-child(1){background-color: #f1f1f1;}
    </style>
@endsection

@section('content')
    <section class="user_list">
        <div style="border-bottom: 2px solid #9955c6;overflow: hidden;">
            <p class="fz_14 account_title fl" style="border: none;"><span style="color: #7f7f7f;"><a href="/console/index">首页</a>>商家版运营></span><span class="co_violet">地推有效用户列表</span></p>
        </div>
        <p class="user_list_search">
            <input class="user_list_searchbtn" type="button" name="submit_search" value="搜索">
            <input type="text" name="search" value="{{$mobile}}" placeholder="搜索">
        </p>
        <table class="display" cellspacing="0" width="100%">
            <thead>
            <tr>
                <th>序号</th>
                <th>用户账号</th>
                <th>手机号归属地</th>
                <th>用户IP</th>
                <th>IP归属地</th>
                <th>用户注册地区</th>
                <th>设备号相同账号</th>
                <th>是否是地推商家并且是否有效</th>
                <th>是否是地推用户并且是否有效</th>
            </tr>
            </thead>
            <tfoot>
            <tr>
                <th>序号</th>
                <th>用户账号</th>
                <th>手机号归属地</th>
                <th>用户IP</th>
                <th>IP归属地</th>
                <th>用户注册地区</th>
                <th>设备号相同账号</th>
                <th>是否是地推商家并且是否有效</th>
                <th>是否是地推用户并且是否有效</th>
            </tr>
            </tfoot>
            <tbody id="tbody_content">
                @foreach($lists as $list)
                    <tr>
                        @if(!isset($i))
                            <td>{{$i=1}}</td>
                        @else
                            <td>{{++$i}}</td>
                        @endif
                        <td>{{$list['mobile']}}</td>
                        <td>{{$list['homelocation']}}</td>
                        <td>{{$list['userip']}}</td>
                        <td>{{$list['ipaddress']}}</td>
                        <td>{{$list['registerarea']}}</td>
                        <td style="width: 280px;word-wrap:break-word;display: inline-block;">{{$list['samedevicemobiles']}}</td>
                        <td>{{$list['salemanshopinfo']}}</td>
                        <td>{{$list['salemanuserinfo']}}</td>
                    </tr>
                @endforeach
            </tbody>
        </table>
    </section>
@endsection

@section('scriptResources')
    @parent
    <script type="text/javascript" src="{{env('JS_DOMAIN')}}js/jquery.qrcode.min.js"></script>
    <script src="{{env('JS_DOMAIN')}}js/jquery.dataTables.min.js?v={{env('JS_VERSION')}}"></script>
    <script>
        $(".user_list_searchbtn").click(function() {
            var search=$("input[name='search']").val();
            window.location.href = "/console/show/user?mobile="+search;
        });
    </script>
@endsection
